package com.cloud.screen.api.controller;

import com.cloud.screen.api.service.PerformService;
import com.cloud.screen.common.result.Quokka;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: quokka-server
 * @description: 履职情况controller
 * @author: sl
 * @create: 2019-08-02 17:35
 **/

@RestController
@RequestMapping("screen/api/perform")
public class PerformController {

    @Autowired
    private PerformService performService;

    /**
     * 履职情况区域分布
     * @param start
     * @param end
     * @param regionid
     * @param recType
     * @return
     */
    @GetMapping("getPerformCaseRegion")
    public Quokka getPerformCaseRegion(String start , String end, Long regionid, Integer recType){
        return new Quokka(true, performService.getPerformCaseRegion(start,end,regionid,recType));
    }

    /**
     * 履职情况 职权数  履职数
     * @param start
     * @param end
     * @param regionid
     * @param recType
     * @return
     */
    @GetMapping("getPerformSummary")
    public Quokka getPerformSummary(String start , String end, Long regionid, Integer recType){
        return new Quokka(true, performService.getPerformSummary(start,end,regionid,recType));
    }

    /**
     * 履职情况  领域前5
     * @param start
     * @param end
     * @param regionid
     * @param recType
     * @return
     */
    @GetMapping("getPerformDomain")
    public Quokka getPerformDomain(String start , String end, Long regionid, Integer recType){
        return new Quokka(true, performService.getPerformDomain(start,end,regionid,recType));
    }

    /**
     * 区间
     * @param start
     * @param end
     * @param regionid
     * @param type
     * @param recType
     * @return
     */
    @GetMapping("getLegalCaseInfo")
    public Quokka getLegalCaseInfo(String start ,String end,Long regionid,Integer type,Integer recType){
        return new Quokka(true, performService.getLegalCaseInfo(start,end,regionid,type,recType));
    }

    /**
     * 履职法律法规top10
     * @param start
     * @param end
     * @param regionid
     * @return
     */

    @GetMapping("getLawCaseTop")
    public Quokka getLawCaseTop(String start ,String end,Long regionid){
        return new Quokka(true, performService.getLawCaseTop(start,end,regionid));
    }

}
